/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.uet.questiondetector.factory;

import edu.uet.questiondetector.utils.XmlTool;
import java.util.Set;

/**
 *
 * @author thinhnk
 */
public class QuestionKeyword {
    private Set<String> keywords;
    public static QuestionKeyword qkeywords = null;
    
    private QuestionKeyword(){
        keywords = XmlTool.readValuesByTag("data/dict/keywords.xml", "keyword");
    }
    
    public static QuestionKeyword instances(){
        if(qkeywords == null){
            qkeywords = new QuestionKeyword();
            return qkeywords;
        }else{
            return qkeywords;
        }
    }
    
    public boolean isKeyword(String token){
        return keywords.contains(token);
    }
}
